-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review rm_rf handling of FileNotFoundErrors #6044
Conversation
7752b9b
to
43cac82
Compare
Should we add some more context (#5974 (comment))? |
43cac82
to
17c765b
Compare
17c765b
to
273ab02
Compare
Added a comment adding more context, and also rebased on |
273ab02
to
ba4b8c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review rm_rf handling of FileNotFoundErrors Conflicts: src/_pytest/pathlib.py testing/test_tmpdir.py
Review rm_rf handling of FileNotFoundErrors Conflicts: src/_pytest/pathlib.py testing/test_tmpdir.py
68: Update pytest to 5.2.2 r=duckinator a=pyup-bot This PR updates [pytest](https://pypi.org/project/pytest) from **5.2.1** to **5.2.2**. <details> <summary>Changelog</summary> ### 5.2.2 ``` ========================= Bug Fixes --------- - `5206 <https://github.com/pytest-dev/pytest/issues/5206>`_: Fix ``--nf`` to not forget about known nodeids with partial test selection. - `5906 <https://github.com/pytest-dev/pytest/issues/5906>`_: Fix crash with ``KeyboardInterrupt`` during ``--setup-show``. - `5946 <https://github.com/pytest-dev/pytest/issues/5946>`_: Fixed issue when parametrizing fixtures with numpy arrays (and possibly other sequence-like types). - `6044 <https://github.com/pytest-dev/pytest/issues/6044>`_: Properly ignore ``FileNotFoundError`` exceptions when trying to remove old temporary directories, for instance when multiple processes try to remove the same directory (common with ``pytest-xdist`` for example). ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/pytest - Changelog: https://pyup.io/changelogs/pytest/ - Homepage: https://docs.pytest.org/en/latest/ </details> Co-authored-by: pyup-bot <[email protected]>
"(rm_rf) unknown function {} when removing {}:\n{}: {}".format( | ||
path, func, exctype, excvalue | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should not warn on open
, should it?
============== test session starts ===============
platform linux -- Python 3.7.4, pytest-4.6.7.dev6+g46aa29ea5.d20191026, py-1.8.1.dev11+g34f716fe, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('…/Vcs/pytest/.hypothesis/examples')
rootdir: …/Vcs/pytest, inifile: tox.ini
plugins: hypothesis-4.23.8, forked-1.0.2, repeat-0.8.0, xdist-1.30.1.dev1+g79dd52b.d20191018
collected 7 items / 5 deselected / 2 selected
testing/test_faulthandler.py EE [100%]
===================== ERRORS =====================
______ ERROR at setup of test_timeout[True] ______
Traceback (most recent call last):
File "/usr/lib/python3.7/shutil.py", line 426, in _rmtree_safe_fd
dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: '.pytest_cache'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/shutil.py", line 494, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib/python3.7/shutil.py", line 432, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
File "/usr/lib/python3.7/shutil.py", line 428, in _rmtree_safe_fd
onerror(os.open, fullname, sys.exc_info())
File "…/Vcs/pytest/src/_pytest/pathlib.py", line 65, in on_rm_rf_error
path, func, exctype, excvalue
pytest.PytestWarning: (rm_rf) unknown function /tmp/pytest-of-user/garbage-d7f65083-c870-4de6-8d7c-acf43dbafdf1/test_cache_failure_warns0/.pytest_cache when removing <built-in function open>:
<class 'PermissionError'>: [Errno 13] Permission denied: '.pytest_cache'
_____ ERROR at setup of test_timeout[False] ______
Traceback (most recent call last):
File "/usr/lib/python3.7/shutil.py", line 426, in _rmtree_safe_fd
dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
PermissionError: [Errno 13] Permission denied: '.pytest_cache'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/shutil.py", line 494, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib/python3.7/shutil.py", line 432, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
File "/usr/lib/python3.7/shutil.py", line 428, in _rmtree_safe_fd
onerror(os.open, fullname, sys.exc_info())
File "…/Vcs/pytest/src/_pytest/pathlib.py", line 65, in on_rm_rf_error
path, func, exctype, excvalue
pytest.PytestWarning: (rm_rf) unknown function /tmp/pytest-of-user/garbage-c10bc5b6-43ba-4bb0-b73d-1ab5d2bbcb1a/test_cache_failure_warns0/.pytest_cache when removing <built-in function open>:
<class 'PermissionError'>: [Errno 13] Permission denied: '.pytest_cache'
============ short test summary info =============
ERROR testing/test_faulthandler.py::test_timeout[True]
ERROR testing/test_faulthandler.py::test_timeout[False]
98: Update pytest to 5.2.2 r=rehandalal a=pyup-bot This PR updates [pytest](https://pypi.org/project/pytest) from **5.2.1** to **5.2.2**. <details> <summary>Changelog</summary> ### 5.2.2 ``` ========================= Bug Fixes --------- - `5206 <https://github.com/pytest-dev/pytest/issues/5206>`_: Fix ``--nf`` to not forget about known nodeids with partial test selection. - `5906 <https://github.com/pytest-dev/pytest/issues/5906>`_: Fix crash with ``KeyboardInterrupt`` during ``--setup-show``. - `5946 <https://github.com/pytest-dev/pytest/issues/5946>`_: Fixed issue when parametrizing fixtures with numpy arrays (and possibly other sequence-like types). - `6044 <https://github.com/pytest-dev/pytest/issues/6044>`_: Properly ignore ``FileNotFoundError`` exceptions when trying to remove old temporary directories, for instance when multiple processes try to remove the same directory (common with ``pytest-xdist`` for example). ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/pytest - Changelog: https://pyup.io/changelogs/pytest/ - Homepage: https://docs.pytest.org/en/latest/ </details> Co-authored-by: pyup-bot <[email protected]>
Also improved the message when we are passed an unknown function.